<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Modules\Admin\Http\Middleware\CheckAuth;
use App\Modules\Admin\Http\Middleware\CheckRabc;
use App\Modules\Admin\Http\Middleware\AdminLog;
use App\Modules\Admin\Http\Middleware\CheckIpBlacklist;
Route::middleware(['cors'])->group(function () {
    Route::prefix(cnpscy_config('admin_prefix'))
        ->middleware([CheckIpBlacklist::class, AdminLog::class])
        ->group(function () {
            Route::post('junda', 'PublicController@junda');
            // Auth
            Route::prefix('auth')->group(function () {
                Route::post('login', 'AuthController@login');
                Route::post('me', 'AuthController@me')->middleware(CheckAuth::class);
                Route::post('logout', 'AuthController@logout')->middleware(CheckAuth::class);
                Route::post('getRabcList', 'AuthController@getRabcList')->middleware(CheckAuth::class);
            });

        });
});
Route::prefix(cnpscy_config('admin_prefix'))
    ->middleware([CheckIpBlacklist::class, AdminLog::class])
    ->group(function() {
        Route::post('junda', 'PublicController@junda');
        // Auth
        Route::prefix('auth')->group(function() {
            Route::post('login', 'AuthController@login');
            Route::post('me', 'AuthController@me')->middleware(CheckAuth::class);
            Route::post('logout', 'AuthController@logout')->middleware(CheckAuth::class);
            Route::post('getRabcList', 'AuthController@getRabcList')->middleware(CheckAuth::class);
        });

        Route::middleware([CheckAuth::class])->group(function () {
            // 检测登录会员是否拥有指定接口的权限
            Route::get('check-permission', 'IndexController@checkApiPermission');
            // 首页
            Route::get('indexs', 'IndexController@index');
            Route::get('water_map', 'IndexController@getWaterList');


            // 编辑登录管理员资料
            Route::put('updateAdmin', 'IndexController@update');
            // 按照日志类型的统计图数据
            Route::get('logsStatistics', 'IndexController@logsStatistics');
            // 版本的历史记录
            Route::get('versionLogs', 'IndexController@versionLogs');
            // 获取服务器状态
            Route::get('getServerStatus', 'IndexController@getServerStatus');
            // 月份表列表
            Route::get('get_month_lists', 'IndexController@getMonthList');


            // 文件上传
            Route::post('upload_file', 'UploadController@file');
            Route::post('upload_oss_sign', 'UploadController@getUploadFileSign');
            Route::post('add_oss_file', 'UploadController@addUploadOssFile');
            // 获取文件列表
            Route::get('getFileList', 'FileController@index');
            // 删除指定文件
            Route::delete('files/delete', 'FileController@delete');
            // 移动文件到指定分组
            Route::put('files/removeFileGroup', 'FileController@removeFileGroup');


            // 获取文件分组列表
            Route::get('getGroupList', 'FileGroupController@index');
            Route::prefix('fileGroup')->group(function() {
                Route::post('/create', 'FileGroupController@create');
                Route::put('/update', 'FileGroupController@update');
                Route::delete('/delete', 'FileGroupController@delete');
            });

            // 数据库管理
            Route::prefix('database')->group(function() {
                // 数据表列表
                Route::get('/tables', 'DatabaseController@index');
                // 数据库备份
                Route::post('/backupsTables', 'DatabaseController@backupsTables');
                // 备份记录
                Route::get('/backups', 'DatabaseController@backups');
                // 删除指定备份记录
                Route::delete('/deleteBackup', 'DatabaseController@deleteBackup');
            });

            /**************************** 打水  *********************************/

            Route::prefix('member')->group(function() {
                Route::prefix('buy')->group(function() {
                    Route::get('/', 'Member\BuyUsersControllers@index');
                    Route::get('/list', 'Member\BuyUsersControllers@index');
                    Route::get('/getSelectlists', 'Member\BuyUsersControllers@getSelectlists');
                    Route::get('/detail', 'Member\BuyUsersControllers@detail');
                    Route::get('/unusual', 'Member\BuyUsersControllers@unusual');
                    Route::post('/role', 'Member\BuyUsersControllers@role');
                    Route::get('/getUsersWaterLists', 'Member\BuyUsersControllers@getUsersWaterLists');
                    Route::put('/updateUsersWater', 'Member\BuyUsersControllers@updateUsersWater');
                    Route::prefix('integra')->group(function() {
                        Route::get('/detail', 'Member\BuyScoreController@getIntegraDetailList');
                    });
                });
                Route::prefix('intake')->group(function() {
                    Route::get('/', 'Member\IntakeUsersControllers@index');
                    Route::post('/create', 'Member\IntakeUsersControllers@create');
                    Route::put('/update', 'Member\IntakeUsersControllers@update');
                    Route::get('/detail', 'Member\IntakeUsersControllers@detail');
                    Route::post('/role', 'Member\IntakeUsersControllers@role');
                    Route::get('/getSelectlists', 'Member\IntakeUsersControllers@getSelectlists');

                    Route::prefix('recharge')->group(function() {
                        Route::get('/', 'Order\IntakeRechargeControllers@index');
                    });
                });
                Route::prefix('card')->group(function() {
                    Route::get('/', 'Member\UsersCardController@index');
                    Route::post('/create', 'Member\UsersCardController@create');
                    Route::put('/update', 'Member\UsersCardController@update');
                    Route::get('/getSelectlists', 'Member\UsersCardController@getSelectlists');
                    Route::get('/detail', 'Member\UsersCardController@detail');
                    Route::put('/updateUsersCard', 'Member\UsersCardController@updateUsersCard');
                    Route::put('/UnbindlingIC', 'Member\UsersCardController@UnbindlingIC');//解绑卡
                    Route::put('/UpdateICBalance', 'Member\UsersCardController@UpdateICBalance');//绑定卡
                });
            });
            Route::prefix('water')->group(function() {
                Route::prefix('member')->group(function() {
                    //
                    Route::get('/list', 'Water\Member\UsersController@index');
                    Route::post('/create', 'Water\Member\UsersController@create');
                    Route::put('/update', 'Water\Member\UsersController@update');
                    Route::get('/getSelectlists', 'Water\Member\UsersController@getSelectlists');
                    Route::get('/detail', 'Water\Member\UsersController@detail');
                    Route::post('/role', 'Water\Member\UsersController@role');
                    Route::get('/unusual', 'Water\Member\UsersController@unusual');
                });
                Route::prefix('vips')->group(function() {
                    // vip
                    Route::get('/list', 'Water\Member\VipController@list');
                    Route::post('/create', 'Water\Member\VipController@create');
                    Route::post('/send', 'Water\Member\VipController@send');
                });

                Route::prefix('cards')->group(function() {
                    //  水卡
                    Route::get('/', 'Water\WaterCardController@index');
                    Route::get('/scoreDetails', 'Water\WaterCardControllerr@getScoreListDetails');
                    Route::post('/create', 'Water\WaterCardController@create');//
                });
            });
            Route::prefix('scores')->group(function() {
                // 积分 - 购买
                 Route::prefix('buy')->group(function() {
                    Route::get('/list', 'Water\Member\GiftScoreController@index');
                    Route::get('/scoreDetails', 'Member\BuyScoreController@getScoreListDetails');
                    Route::post('/create', 'Water\Member\GiftScoreController@create');// 赠送积分
                });
            });

            Route::prefix('apparatus')->group(function() {
                Route::get('/', 'Water\WaterDeviceControllers@index');
                Route::get('/detail', 'Water\WaterDeviceControllers@details');
                Route::get('/alllist', 'Water\WaterDeviceControllers@getSelectlists');
                Route::get('/alllistjd', 'Water\WaterDeviceControllers@getJundaSelectlists');
                Route::get('/getWateRate', 'Water\WaterDeviceControllers@getWateRate');
                Route::post('/create', 'Water\WaterDeviceControllers@create');
                Route::put('/changeFiledStatus', 'Water\WaterDeviceControllers@changeFiledStatus');
                Route::put('/update', 'Water\WaterDeviceControllers@update');
                Route::put('/updatedbjd', 'Water\WaterDeviceControllers@updatedbjd');
                Route::delete('/delete', 'Water\WaterDeviceControllers@delete');
                Route::prefix('params')->group(function() {
                    Route::get('/', 'Apparatus\EquipmentParamsController@listParam');
                    Route::put('/update', 'Apparatus\EquipmentParamsController@updateParam');
                });
                Route::prefix('user')->group(function() {
                    //绑定水卡
                    Route::get('/alllist', 'Water\WaterDeviceControllers@getUserSelectlists');
                    Route::post('/bind', 'Apparatus\ApparatusUserController@bindUser');//绑定水机用户
                    Route::post('/unbind', 'Apparatus\ApparatusUserController@unbindUser');
                    Route::post('/sign', 'Apparatus\ApparatusUserController@signUser');
                });
                Route::prefix('prices')->group(function() {
                    Route::post('/property_fee', 'Water\WaterDeviceControllers@updatePropertyFee');//填写物业费
                    Route::post('/electricity', 'Water\WaterDeviceControllers@updateElectricity');//填写电费
                    Route::post('/water_rate', 'Water\WaterDeviceControllers@updateWaterRate');//填写水费

                    Route::prefix('logs')->group(function() {
                        Route::get('/property_fee', 'Apparatus\ApparatusLogController@getPropertyFee');//查看物业费记录
                        Route::get('/electricity', 'Apparatus\ApparatusLogController@getElectricity');//查看电费记录
                        Route::get('/water_rate', 'Apparatus\ApparatusLogController@getWaterRate');//查看水费记录
                    });
                });
            });

            Route::prefix('apparatusjd')->group(function() {
                Route::get('/', 'Apparatus\ApparatusJdController@getJundaSelectlists');
                Route::post('/create', 'Apparatus\ApparatusJdController@create');
                Route::get('/detail', 'Apparatus\ApparatusJdController@details');
                Route::put('/update', 'Apparatus\ApparatusJdController@update');
                Route::get('/online', 'Apparatus\ApparatusJdController@getOnlineStatus');
                Route::put('/changeFiledStatus', 'Apparatus\ApparatusJdController@changeFiledStatus');

            });
            Route::prefix('property')->group(function() {
                Route::prefix('check')->group(function() {
                    Route::prefix('category')->group(function() {
                        Route::get('/', 'Property\CheckCategoryController@index');
                        Route::post('/create', 'Property\CheckCategoryController@create');
                        Route::get('/detail', 'Property\CheckCategoryController@detail');
                        Route::put('/update', 'Property\CheckCategoryController@update');
                        Route::delete('/delete', 'Property\CheckCategoryController@delete');
                        Route::get('/alllist', 'Property\CheckCategoryController@getSelectlists');
                        Route::get('/allItemList', 'Property\CheckCategoryController@getItemSelectlists');
                        Route::put('/changeFiledStatus', 'Property\CheckCategoryController@changeFiledStatus');
                    });
                    Route::prefix('item')->group(function() {
                        Route::get('/', 'Property\CheckItemController@index');
                        Route::post('/create', 'Property\CheckItemController@create');
                        Route::get('/detail', 'Property\CheckItemController@detail');
                        Route::put('/update', 'Property\CheckItemController@update');
                        Route::delete('/delete', 'Property\CheckItemController@delete');
                        Route::get('/alllist', 'Property\CheckItemController@getSelectlists');
                        Route::put('/changeFiledStatus', 'Property\CheckItemController@changeFiledStatus');
                    });
                });
                Route::prefix('water')->group(function() {
                    Route::prefix('coupon')->group(function() {
                        Route::get('/', 'Property\WaterCouponController@index');
                        Route::post('/create', 'Property\WaterCouponController@create');
                        Route::get('/detail', 'Property\WaterCouponController@detail');
                        Route::put('/update', 'Property\WaterCouponController@update');
                        Route::delete('/delete', 'Property\WaterCouponController@delete');
                        Route::get('/alllist', 'Property\WaterCouponController@getSelectlists');
                        Route::put('/changeFiledStatus', 'Property\WaterCouponController@changeFiledStatus');
                    });
                });
                Route::prefix('maintenance')->group(function() {
                    Route::get('/', 'Property\MaintenanceController@index');
                    Route::get('/indexs', 'Property\MaintenanceController@indexs');
                    Route::post('/create', 'Property\MaintenanceController@create');
                    Route::get('/detail', 'Property\MaintenanceController@detail');
                    Route::put('/update', 'Property\MaintenanceController@update');
                    Route::delete('/delete', 'Property\MaintenanceController@delete');
                    Route::get('/alllist', 'Property\MaintenanceController@getSelectlists');
                    Route::put('/changeFiledStatus', 'Property\MaintenanceController@changeFiledStatus');
                });
                Route::prefix('contract')->group(function() {
                    Route::get('/', 'Property\ContractController@index');
                    Route::post('/create', 'Property\ContractController@create');
                    Route::get('/detail', 'Property\ContractController@detail');
                    Route::put('/update', 'Property\ContractController@update');
                    Route::delete('/delete', 'Property\ContractController@delete');
                    Route::get('/alllist', 'Property\ContractController@getSelectlists');
                    Route::put('/changeFiledStatus', 'Property\ContractController@changeFiledStatus');
                });
                Route::prefix('user')->group(function() {
                    Route::get('/list', 'Property\MaintenanceController@index');
                    Route::get('/show', 'Property\MaintenanceController@show');
                    Route::get('/alllist', 'Property\MaintenanceController@getSelectlists');
                    Route::post('/create', 'Property\MaintenanceController@create');
                    Route::put('/changeFiledStatus', 'Property\MaintenanceController@changeFiledStatus');
                    Route::put('/update', 'Property\MaintenanceController@update');
                    Route::delete('/delete', 'Property\MaintenanceController@delete');
                });
                //客情
                Route::prefix('ClientRelation')->group(function() {
                    Route::get('/list', 'Property\ClientRelationController@index');
                    Route::get('/show', 'Property\ClientRelationController@show');
                    Route::get('/alllist', 'Property\ClientRelationController@getSelectlists');
                    Route::post('/create', 'Property\ClientRelationController@create');
                    Route::put('/changeFiledStatus', 'Property\ClientRelationController@changeFiledStatus');
                    Route::put('/update', 'Property\ClientRelationController@update');
                    Route::delete('/delete', 'Property\ClientRelationController@delete');
                });

            });
            Route::prefix('communities')->group(function() {
                Route::get('/', 'Community\CommunityController@index');
                Route::get('/getSelectLists', 'Community\CommunityController@getSelectLists');
                Route::get('/detail', 'Community\CommunityController@detail');
                Route::post('/create', 'Community\CommunityController@create');
                Route::put('/changeFiledStatus', 'Community\CommunityController@changeFiledStatus');
                Route::put('/update', 'Community\CommunityController@update');
                Route::delete('/delete', 'Community\CommunityController@delete');
            });
            Route::prefix('expenses')->group(function() {
                Route::prefix('master')->group(function() {
                    Route::get('/', 'Expenses\MasterController@index');
                    Route::get('/detail', 'Expenses\MasterController@detail');
                    Route::post('/create', 'Expenses\MasterController@create');
                    Route::put('/changeFiledStatus', 'Expenses\MasterController@changeFiledStatus');
                    Route::put('/update', 'Expenses\MasterController@update');
                    Route::delete('/delete', 'Expenses\MasterController@delete');
                    Route::get('/getSelectLists', 'Expenses\MasterController@getSelectLists');
                });
                Route::prefix('master_read')->group(function() {
                    Route::get('/', 'Expenses\MasterReadController@index');
                    Route::get('/detail', 'Expenses\MasterReadController@detail');
                    Route::get('/masterReadDetail', 'Expenses\MasterReadController@getDetail');
                    Route::post('/create', 'Expenses\MasterReadController@create');
                    Route::put('/changeFiledStatus', 'Expenses\MasterReadController@changeFiledStatus');
                    Route::put('/update', 'Expenses\MasterReadController@update');
                    Route::delete('/delete', 'Expenses\MasterReadController@delete');
                });
                Route::prefix('property')->group(function() {
                    Route::get('/', 'Expenses\PropertyController@index');
                    Route::get('/detail', 'Expenses\PropertyController@detail');
                    Route::get('/masterReadDetail', 'Expenses\PropertyController@getDetail');
                    Route::post('/create', 'Expenses\PropertyController@create');
                    Route::put('/changeFiledStatus', 'Expenses\PropertyController@changeFiledStatus');
                    Route::put('/update', 'Expenses\PropertyController@update');
                    Route::delete('/delete', 'Expenses\PropertyController@delete');
                    Route::prefix('log')->group(function() {
                        Route::get('/', 'Expenses\PropertyLogController@index');
                        Route::post('/create', 'Expenses\PropertyLogController@create');
                        Route::put('/update', 'Expenses\PropertyLogController@update');
                    });
                });
            });


            // 数据中心
            Route::prefix('bus')->group(function() {
                //充值
                Route::prefix('charge')->group(function() {
                    Route::get('/', 'Bus\BusChargeController@index');
                    Route::post('/create', 'Bus\BusChargeController@createRecharge');
                    Route::post('/refund', 'Bus\BusChargeController@refundRecharge');
                    Route::get('/detail', 'Bus\BusChargeController@detail');
                });
                //x消费记录
                Route::prefix('consume')->group(function() {
                    Route::get('/', 'Bus\ConsumeController@index');
                    Route::get('/detail', 'Bus\ConsumeController@detail');
                    Route::get('/detailConsume', 'Bus\ConsumeController@detailConsume');
                    Route::post('/refund', 'Bus\ConsumeController@refundConsume');
                });
                // 积分 提现
                Route::prefix('extract')->group(function() {
                    Route::get('/', 'Bus\BuyExtractController@index');
                    Route::get('/scoreDetails', 'Bus\BuyExtractController@getScoreListDetails');
                    Route::post('/confirmpayment', 'Bus\BuyExtractController@confirmpayment');// 确认打款
                });
            });
            // 统计
            Route::prefix('statistics')->group(function() {
                Route::get('/apparatus', 'Water\StatisticController@apparatus');
                Route::get('/scores', 'Water\StatisticController@scores');
                Route::get('/all_scores', 'Water\StatisticController@allScores');
                Route::get('/property_fee', 'Water\StatisticController@propertyFee');
            });
            /**************************** 商城   *********************************/

            Route::prefix('mall')->group(function() {
                Route::prefix('category')->group(function() {
                    Route::get('/', 'Mall\CategoryController@index');
                    Route::get('/detail', 'Mall\CategoryController@detail');
                    Route::post('/create', 'Mall\CategoryController@create');
                    Route::put('/update', 'Mall\CategoryController@update');
                    Route::delete('/delete', 'Mall\CategoryController@delete');
                    Route::get('/getSelectLists', 'Mall\CategoryController@getSelectLists');
                    Route::put('/changeFiledStatus', 'Mall\CategoryController@changeFiledStatus');
                });
                Route::prefix('goods')->group(function() {
                    Route::get('/', 'Mall\GoodsController@index');
                    Route::get('/detail', 'Mall\GoodsController@detail');
                    Route::post('/create', 'Mall\GoodsController@create');
                    Route::put('/update', 'Mall\GoodsController@update');
                    Route::delete('/delete', 'Mall\GoodsController@delete');
                    Route::get('/getSelectLists', 'Mall\GoodsController@getSelectLists');
                    Route::put('/changeFiledStatus', 'Mall\GoodsController@changeFiledStatus');
                });
                Route::prefix('product')->group(function() {
                    Route::prefix('rule')->group(function() {
                        Route::get('/', 'Mall\GoodsRuleTplController@index');
                        Route::get('/detail', 'Mall\GoodsRuleTplController@detail');
                        Route::post('/create', 'Mall\GoodsRuleTplController@create');
                        Route::put('/update', 'Mall\GoodsRuleTplController@update');
                        Route::delete('/delete', 'Mall\GoodsRuleTplController@delete');
                        Route::get('/getSelectLists', 'Mall\GoodsRuleTplController@getSelectLists');
                        Route::put('/changeFiledStatus', 'Mall\GoodsRuleTplController@changeFiledStatus');
                    });
                    Route::prefix('label')->group(function() {
                        Route::get('/', 'Mall\GoodsLabelController@index');
                        Route::get('/detail', 'Mall\GoodsLabelController@detail');
                        Route::post('/create', 'Mall\GoodsLabelController@create');
                        Route::put('/update', 'Mall\GoodsLabelController@update');
                        Route::delete('/delete', 'Mall\GoodsLabelController@delete');
                        Route::get('/getSelectLists', 'Mall\GoodsLabelController@getSelectLists');
                        Route::put('/changeFiledStatus', 'Mall\GoodsLabelController@changeFiledStatus');
                    });
                });
                Route::prefix('order')->group(function() {
                    //订单列表
                    Route::get('/', 'Mall\GoodsOrderController@index');
                    Route::get('/detail', 'Mall\GoodsOrderController@getDetail');
                    Route::get('/count', 'Mall\GoodsOrderController@getDetail');
                    Route::post('/create', 'Mall\GoodsOrderController@create');
                    Route::post('/take', 'Mall\GoodsOrderController@createTake');
                    Route::put('/update', 'Mall\GoodsOrderController@update');
                    Route::delete('/delete', 'Mall\GoodsOrderController@delete');
                    Route::prefix('refund')->group(function() {
                        // 售后订单
                        Route::get('/', 'Mall\OrderRefundController@lists');
                        Route::get('/detail', 'Mall\OrderRefundController@detail');// 退款/退款 详情
                        Route::post('/create', 'Mall\OrderRefundController@create');// 退款/退款 提交
                        Route::put('/update', 'Mall\OrderRefundController@update');
                        Route::delete('/delete', 'Mall\OrderRefundController@delete');
                        Route::get('/getSelectLists', 'Mall\OrderRefundController@getSelectLists');
                        Route::put('/changeFiledStatus', 'Mall\OrderRefundController@changeFiledStatus');
                        Route::get('/reason', 'Mall\OrderRefundController@getReason');//退货理由
                    });
                });
            });

            /**************************** 商城 end  *********************************/
            /**************************** 打水 end  *********************************/
            Route::prefix('sys')->group(function() {
                Route::prefix('dict')->group(function() {
                    Route::prefix('type')->group(function() {
                        Route::get('/index', 'System\SysDictTypeController@index');
                        Route::get('/detail', 'System\SysDictTypeController@detail');
                        Route::post('/create', 'System\SysDictTypeController@create');
                        Route::put('/update', 'System\SysDictTypeController@update');
                        Route::delete('/delete', 'System\SysDictTypeController@delete');
                        Route::get('/getSelectLists', 'System\SysDictTypeController@getSelectLists');
                    });
                    Route::prefix('data')->group(function() {
                        Route::get('/index', 'System\SysDictDataController@index');
                        Route::get('/detail', 'System\SysDictDataController@detail');
                        Route::post('/create', 'System\SysDictDataController@create');
                        Route::put('/update', 'System\SysDictDataController@update');
                        Route::delete('/delete', 'System\SysDictDataController@delete');
                        Route::get('/getSelectLists', 'System\SysDictDataController@getSelectLists');
                    });
                });
                Route::prefix('area')->group(function() {
                    Route::get('/', 'System\SystemCityController@index');
                    Route::get('/detail', 'System\SystemCityController@detail');
                    Route::post('/create', 'System\SystemCityController@create');
                    Route::put('/update', 'System\SystemCityController@update');
                    Route::delete('/delete', 'System\SystemCityController@delete');
                    Route::get('/getSelectLists', 'System\SystemCityController@getSelectLists');
                    Route::get('/getSelectCityLists', 'System\SystemCityController@getSelectCityLists');
                    Route::get('/getParentLists', 'System\SystemCityController@getParentLists') ;
                });
                Route::get('/feedback', 'System\FeedbackController@index');

                Route::prefix('warranty')->group(function() {
                    Route::get('/', 'Apparatus\DeviceWarrantyController@index');
                    Route::put('/update', 'Apparatus\DeviceWarrantyController@update');
                });
                Route::prefix('company')->group(function() {
                    Route::get('/', 'System\CompanyController@index');
                    Route::post('/create', 'System\CompanyController@create');
                    Route::get('/detail', 'System\CompanyController@detail');
                    Route::put('/update', 'System\CompanyController@update');
                    Route::delete('/delete', 'System\CompanyController@delete');
                    Route::get('/alllist', 'System\CompanyController@getSelectlists');
                    Route::put('/changeFiledStatus', 'System\CompanyController@changeFiledStatus');
                });
                Route::prefix('site')->group(function() {
                    Route::get('/', 'System\SiteController@index');
                    Route::post('/create', 'System\SiteController@create');
                    Route::get('/detail', 'System\SiteController@detail');
                    Route::put('/update', 'System\SiteController@update');
                    Route::delete('/delete', 'System\SiteController@delete');
                    Route::get('/alllist', 'System\SiteController@getSelectlists');
                    Route::put('/changeFiledStatus', 'System\SiteController@changeFiledStatus');
                });

            });
            // 权限中间件
            Route::middleware([CheckRabc::class])->group(function () {
                Route::prefix('banners')->group(function() {
                    Route::get('/', 'System\BannerController@index');
                    Route::post('/create', 'System\BannerController@create');
                    Route::put('/update', 'System\BannerController@update');
                    Route::delete('/delete', 'System\BannerController@delete');
                    Route::put('/changeFiledStatus', 'System\BannerController@changeFiledStatus');
                });

                // 配置管理
                Route::prefix('setting')->group(function() {
                    Route::prefix('agreement')->group(function () {
                        Route::get('/', 'System\AgreementController@getIndexInfo');
                        Route::get('/get_agreement', 'System\AgreementController@getAgreementInfo');
                        Route::post('/create', 'System\AgreementController@create');
                        Route::put('/save_agreement ', 'System\AgreementController@agreementUpdate');
                        Route::delete('/delete', 'System\AgreementController@delete');
                    });
                });
                // 配置管理
                Route::prefix('configs')->group(function() {
                    Route::get('/', 'System\ConfigController@index');
                    Route::get('/detail', 'System\ConfigController@detail');
                    Route::post('/create', 'System\ConfigController@create');
                    Route::put('/update', 'System\ConfigController@update');
                    Route::delete('/delete', 'System\ConfigController@delete');
                    Route::put('/changeFiledStatus', 'System\ConfigController@changeFiledStatus');
                    Route::get('/getConfigGroupType', 'System\ConfigController@getConfigGroupType')->withoutMiddleware([CheckRabc::class]);
                     Route::put('/pushRefreshConfig', 'System\ConfigController@pushRefreshConfig');
                });


                Route::prefix('versions')->group(function() {
                    Route::get('/', 'System\VersionController@index');
                    Route::post('/create', 'System\VersionController@create');
                    Route::put('/update', 'System\VersionController@update');
                    Route::delete('/delete', 'System\VersionController@delete');
                    Route::put('/changeFiledStatus', 'System\VersionController@changeFiledStatus');
                });

                Route::prefix('rabc')->group(function() {
                    Route::prefix('admins')->group(function () {
                        Route::get('/', 'Rabc\AdminController@index');
                        Route::post('/create', 'Rabc\AdminController@create');
                        Route::put('/update', 'Rabc\AdminController@update');
                        Route::delete('/delete', 'Rabc\AdminController@delete');
                        Route::get('/getSelectLists', 'Rabc\AdminController@getSelectLists');
                        Route::put('/changeFiledStatus', 'Rabc\AdminController@changeFiledStatus');
                    });

                    Route::prefix('roles')->group(function () {
                        Route::get('/', 'Rabc\AdminRoleController@index');
                        Route::post('/create', 'Rabc\AdminRoleController@create');
                        Route::put('/update', 'Rabc\AdminRoleController@update');
                        Route::delete('/delete', 'Rabc\AdminRoleController@delete');
                        Route::get('/getSelectLists', 'Rabc\AdminRoleController@getSelectLists')->withoutMiddleware([CheckRabc::class]);
                        Route::put('/changeFiledStatus', 'Rabc\AdminRoleController@changeFiledStatus');
                    });

                    Route::prefix('menus')->group(function () {
                        Route::get('/', 'Rabc\AdminMenuController@index');
                        Route::get('/detail', 'Rabc\AdminMenuController@detail');
                        Route::post('/create', 'Rabc\AdminMenuController@create');
                        Route::put('/update', 'Rabc\AdminMenuController@update');
                        Route::delete('/delete', 'Rabc\AdminMenuController@delete');
                        Route::get('/getSelectLists', 'Rabc\AdminMenuController@getSelectLists')->withoutMiddleware([CheckRabc::class]);
                        Route::put('/changeFiledStatus', 'Rabc\AdminMenuController@changeFiledStatus');
                    });
                });

                // 管理员日志
                Route::prefix('logs')->group(function() {
                    Route::prefix('adminlogs')->group(function () {
                        Route::get('/', 'Log\AdminLogController@index');
                        Route::delete('/delete', 'Log\AdminLogController@delete');
                    });

                    // 管理员登录日志
                    Route::prefix('adminloginlogs')->group(function () {
                        Route::get('/', 'Log\AdminLoginLogController@index');
                        Route::delete('/delete', 'Log\AdminLoginLogController@delete');
                    });
                });
              /*  // 文章分类
                Route::prefix('article')->group(function() {
                    Route::get('/', 'Article\ArticleController@index');
                    Route::get('/detail', 'Article\ArticleController@detail');
                    Route::post('/create', 'Article\ArticleController@create');
                    Route::put('/update', 'Article\ArticleController@update');
                    Route::delete('/delete', 'Article\ArticleController@delete');
                    Route::put('/changeFiledStatus', 'Article\ArticleController@changeFiledStatus');
                    Route::prefix('categories')->group(function () {
                        Route::get('/', 'Article\ArticleCategoryController@index');
                        Route::post('/create', 'Article\ArticleCategoryController@create');
                        Route::put('/update', 'Article\ArticleCategoryController@update');
                        Route::delete('/delete', 'Article\ArticleCategoryController@delete');
                        Route::get('/getSelectLists', 'Article\ArticleCategoryController@getSelectLists')->withoutMiddleware([CheckRabc::class]);
                        Route::put('/changeFiledStatus', 'Article\ArticleCategoryController@changeFiledStatus');
                    });

                    // 文章标签
                    Route::prefix('labels')->group(function () {
                        Route::get('/', 'Article\ArticleLabelController@index');
                        Route::post('/create', 'Article\ArticleLabelController@create');
                        Route::put('/update', 'Article\ArticleLabelController@update');
                        Route::delete('/delete', 'Article\ArticleLabelController@delete');
                        Route::get('/getSelectLists', 'Article\ArticleLabelController@getSelectLists')->withoutMiddleware([CheckRabc::class]);
                    });
                });*/

            });
        });
    });
